<?php
include("../safe.php");
?> 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title><?php echo $site_name;?>后台管理-批量修改图片尺寸</title>
<link href="../bootstrap/css/bootstrap.min.css" title="" rel="stylesheet" />
<link href="../css/mcommon.css" rel="stylesheet" title="" type="text/css" />
<link href="../css/style.css" rel="stylesheet" type="text/css"  />
<link rel="shortcut icon" href="/logo.ico" />
<style type="text/css">
<!--
.shuchu{ font-size:12px; line-height:20px;}
-->
</style>
<script src="../js/jquery-1.11.1.min.js" type="text/javascript"></script>
</head>

<body>
<!--顶部-->
<?php include("../top.php");?> 
<!--顶部结束--->
<!--主体部分-->
<div class="down-main">
	<!--左侧部分-->
  <?php include("../left.php");?> 
  <!--左侧部分结束-->
  <!--右侧部分-->
  <div class="right-product right-full">
  	<!--右侧内容部分-->
    <div class="container-fluid right-product-con">
    	<div class="mianbaoxie"><i class="glyphicon-folder-open glyphicon"></i>
    		<span>管理中心</span>&gt;<span>产品管理</span>&gt;<span class="dangqian">批量修改图片尺寸</span></div>
      <div class="container-con">
      		<!--表格-->
      		<div class="tableCon">
			<div class="tableCon-tit clear">批量修改图片尺寸</div>
	      		<div class="tableCon-content"><h3>当前分类：<?php echo $_GET["bname"];?></h3>
				<form id="form1" name="form1" method="post" action="?bname=<?php echo $_GET["bname"];?>&lang=<?php echo $_GET["lang"];?>" class="form-inline">
				
  <div class="form-group">
  调整图片尺寸 -><input type="number" name="width" id="width" class="form-control" placeholder="图片宽度"/> -
    
  <input type="number" name="height" id="height" class="form-control" placeholder="图片高度"/>
 <input  value="执行" type="submit"  class="btn btn-success form-control-static"/>
  </div></form>
  <div class="shuchu"></div>
  <script type="text/javascript">
  <?php
  $width=(int)$_POST["width"];
  $height=(int)$_POST["height"];
  $bname=$_GET["bname"];
  $lang=$_GET["lang"];
  if($width>0&&$height>0){
  $sql="select * from ph_".$lang." where 1=1 and bname='".$bname."'";
  $result=mysqli_query($conn,$sql);
  while($row=mysqli_fetch_array($result)){
  ?>
  
  $.ajax({
                    type: "post",
                    url: "http://<?php echo $_SERVER['SERVER_NAME'];?>/category/resizeinfo.php?id=<?php echo $row["ID"];?>",
                    data: {width:"<?php echo $width;?>",height:"<?php echo $height;?>"},
                    dataType: "html",
                    success: function (data) {
                        /*数据不够10条隐藏按钮*/
                        insertDiv(data);
                    }
                });
  <?php 
  }
  }
  ?>
  function insertDiv(data){
            var information = $(".shuchu");
            information.append(data);
        }
		</script>
	      		</div>
	      	</div>
	      	<!--表格结束--->
      	</div>
      </div>
  </div>
	  <!--右侧内容部分结束-->
  </div>
  <!--右侧部分结束-->
</div>
<!--主体部分结束-->

<script src="../bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../js/mcommon.js"></script>
</body>
</html>
